/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package doan.quanlycanbo.portlet.model;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.model.impl.BaseModelImpl;

import java.io.Serializable;

import java.lang.reflect.Proxy;

/**
 * @author Nguyen Tuan Vinh
 */
public class donviClp extends BaseModelImpl<donvi> implements donvi {
	public donviClp() {
	}

	public long getPrimaryKey() {
		return _madonvi;
	}

	public void setPrimaryKey(long pk) {
		setMadonvi(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return new Long(_madonvi);
	}

	public long getMadonvi() {
		return _madonvi;
	}

	public void setMadonvi(long madonvi) {
		_madonvi = madonvi;
	}

	public long getGroupId() {
		return _groupId;
	}

	public void setGroupId(long groupId) {
		_groupId = groupId;
	}

	public long getCompanyId() {
		return _companyId;
	}

	public void setCompanyId(long companyId) {
		_companyId = companyId;
	}

	public String getLanguageId() {
		return _languageId;
	}

	public void setLanguageId(String languageId) {
		_languageId = languageId;
	}

	public long getMakhoi() {
		return _makhoi;
	}

	public void setMakhoi(long makhoi) {
		_makhoi = makhoi;
	}

	public long getDonvicha() {
		return _donvicha;
	}

	public void setDonvicha(long donvicha) {
		_donvicha = donvicha;
	}

	public long getOrgId() {
		return _orgId;
	}

	public void setOrgId(long orgId) {
		_orgId = orgId;
	}

	public String getTendonvi() {
		return _tendonvi;
	}

	public void setTendonvi(String tendonvi) {
		_tendonvi = tendonvi;
	}

	public String getDiachi() {
		return _diachi;
	}

	public void setDiachi(String diachi) {
		_diachi = diachi;
	}

	public String getDienthoai() {
		return _dienthoai;
	}

	public void setDienthoai(String dienthoai) {
		_dienthoai = dienthoai;
	}

	public String getFax() {
		return _fax;
	}

	public void setFax(String fax) {
		_fax = fax;
	}

	public String getEmail() {
		return _email;
	}

	public void setEmail(String email) {
		_email = email;
	}

	public String getWebsite() {
		return _website;
	}

	public void setWebsite(String website) {
		_website = website;
	}

	public String getHinhanh() {
		return _hinhanh;
	}

	public void setHinhanh(String hinhanh) {
		_hinhanh = hinhanh;
	}

	public String getGioithieuchung() {
		return _gioithieuchung;
	}

	public void setGioithieuchung(String gioithieuchung) {
		_gioithieuchung = gioithieuchung;
	}

	public donvi toEscapedModel() {
		if (isEscapedModel()) {
			return this;
		}
		else {
			return (donvi)Proxy.newProxyInstance(donvi.class.getClassLoader(),
				new Class[] { donvi.class }, new AutoEscapeBeanHandler(this));
		}
	}

	public Object clone() {
		donviClp clone = new donviClp();

		clone.setMadonvi(getMadonvi());
		clone.setGroupId(getGroupId());
		clone.setCompanyId(getCompanyId());
		clone.setLanguageId(getLanguageId());
		clone.setMakhoi(getMakhoi());
		clone.setDonvicha(getDonvicha());
		clone.setOrgId(getOrgId());
		clone.setTendonvi(getTendonvi());
		clone.setDiachi(getDiachi());
		clone.setDienthoai(getDienthoai());
		clone.setFax(getFax());
		clone.setEmail(getEmail());
		clone.setWebsite(getWebsite());
		clone.setHinhanh(getHinhanh());
		clone.setGioithieuchung(getGioithieuchung());

		return clone;
	}

	public int compareTo(donvi donvi) {
		int value = 0;

		value = getTendonvi().compareTo(donvi.getTendonvi());

		value = value * -1;

		if (value != 0) {
			return value;
		}

		return 0;
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		donviClp donvi = null;

		try {
			donvi = (donviClp)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		long pk = donvi.getPrimaryKey();

		if (getPrimaryKey() == pk) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return (int)getPrimaryKey();
	}

	public String toString() {
		StringBundler sb = new StringBundler(31);

		sb.append("{madonvi=");
		sb.append(getMadonvi());
		sb.append(", groupId=");
		sb.append(getGroupId());
		sb.append(", companyId=");
		sb.append(getCompanyId());
		sb.append(", languageId=");
		sb.append(getLanguageId());
		sb.append(", makhoi=");
		sb.append(getMakhoi());
		sb.append(", donvicha=");
		sb.append(getDonvicha());
		sb.append(", orgId=");
		sb.append(getOrgId());
		sb.append(", tendonvi=");
		sb.append(getTendonvi());
		sb.append(", diachi=");
		sb.append(getDiachi());
		sb.append(", dienthoai=");
		sb.append(getDienthoai());
		sb.append(", fax=");
		sb.append(getFax());
		sb.append(", email=");
		sb.append(getEmail());
		sb.append(", website=");
		sb.append(getWebsite());
		sb.append(", hinhanh=");
		sb.append(getHinhanh());
		sb.append(", gioithieuchung=");
		sb.append(getGioithieuchung());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(49);

		sb.append("<model><model-name>");
		sb.append("doan.quanlycanbo.portlet.model.donvi");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>madonvi</column-name><column-value><![CDATA[");
		sb.append(getMadonvi());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>groupId</column-name><column-value><![CDATA[");
		sb.append(getGroupId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>companyId</column-name><column-value><![CDATA[");
		sb.append(getCompanyId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>languageId</column-name><column-value><![CDATA[");
		sb.append(getLanguageId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>makhoi</column-name><column-value><![CDATA[");
		sb.append(getMakhoi());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>donvicha</column-name><column-value><![CDATA[");
		sb.append(getDonvicha());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>orgId</column-name><column-value><![CDATA[");
		sb.append(getOrgId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>tendonvi</column-name><column-value><![CDATA[");
		sb.append(getTendonvi());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>diachi</column-name><column-value><![CDATA[");
		sb.append(getDiachi());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>dienthoai</column-name><column-value><![CDATA[");
		sb.append(getDienthoai());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>fax</column-name><column-value><![CDATA[");
		sb.append(getFax());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>email</column-name><column-value><![CDATA[");
		sb.append(getEmail());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>website</column-name><column-value><![CDATA[");
		sb.append(getWebsite());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>hinhanh</column-name><column-value><![CDATA[");
		sb.append(getHinhanh());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>gioithieuchung</column-name><column-value><![CDATA[");
		sb.append(getGioithieuchung());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private long _madonvi;
	private long _groupId;
	private long _companyId;
	private String _languageId;
	private long _makhoi;
	private long _donvicha;
	private long _orgId;
	private String _tendonvi;
	private String _diachi;
	private String _dienthoai;
	private String _fax;
	private String _email;
	private String _website;
	private String _hinhanh;
	private String _gioithieuchung;
}